package com.jemmyee.core.entity;
// default package

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * @Description:虚拟货币明细  eg:点数
 * @author:jemmyee@gmail.com
 * @date:2011-9-5
 * @version:v1.0
 */
@Entity(name="com.jemmyee.core.entity.PointsLog")
@Table(name="core_user_points_log")
public class PointsLog extends BaseEntity implements java.io.Serializable {

    // Fields    
     private String id;
     private Integer points; //点数
     private Short type;     // 1 购买  2兑现
     private Date addTime;
     private String ip;
     private Integer userId;
     private Integer adminId; //管理员操作ID
     private Short isDelete;
     
     
     private User user;
     private AdminUser admin;
 	// 关系映射
 	@ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
 	@JoinColumn(name = "user_id", insertable = false, updatable = false, nullable = true)
    public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
 	// 关系映射
 	@ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
 	@JoinColumn(name = "admin_id", insertable = false, updatable = false, nullable = true)
	public AdminUser getAdmin() {
		return admin;
	}

	public void setAdmin(AdminUser admin) {
		this.admin = admin;
	}

    // Constructors
    /** default constructor */
    public PointsLog() {
    }
   
    // Property accessors
    @GenericGenerator(name="generator", strategy="uuid")
    @Id @GeneratedValue(generator="generator")
    @Column(name="id", unique=true, nullable=false, length=32)
    public String getId() {
        return this.id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    @Column(name="points")

    public Integer getPoints() {
        return this.points;
    }
    
    public void setPoints(Integer points) {
        this.points = points;
    }
    
    @Column(name="type")

    public Short getType() {
        return this.type;
    }
    
    public void setType(Short type) {
        this.type = type;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="add_time", length=0)

    public Date getAddTime() {
        return this.addTime;
    }
    
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }
    
    @Column(name="ip", length=20)

    public String getIp() {
        return this.ip;
    }
    
    public void setIp(String ip) {
        this.ip = ip;
    }
    
    @Column(name="user_id")

    public Integer getUserId() {
        return this.userId;
    }
    
    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    
    @Column(name="admin_id")

    public Integer getAdminId() {
        return this.adminId;
    }
    
    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }
    
    @Column(name="is_delete")

    public Short getIsDelete() {
        return this.isDelete;
    }
    
    public void setIsDelete(Short isDelete) {
        this.isDelete = isDelete;
    }
   








}